Please specify the schema :
@AssistantIntent(schema: .system.search)
Also specify the scope :
static let searchScopes: [StringSearchScope] = [.general]
Post
Replies
Boosts
Views
Activity
** If you would like to implement the same prior to iOS 18** , you can conform to AppIntent rather ShowInAppSearchResultsIntent.
You can have a parameter that takes in a line of text :
@Parameter(title: "Enter the search text:", inputOptions: String.IntentInputOptions.init(multiline: false))
var helpText: String
Sample Code :
struct SearchIntent: AppIntent {
static let title: LocalizedStringResource = "Search"
static var openAppWhenRun: Bool = false
@Parameter(title: "Enter the search text", inputOptions: String.IntentInputOptions.init(multiline: false))
var searchText: String
@MainActor
func perform() async throws -> some IntentResult { // & ProvidesDialog & ShowsSnippetView
//Do your processing here
return .result(result: "I found something related to your search (searchText)")
}
}
@reed.1325 : I have the same problem, app opens but app delegate is not notified. Reed, do u have a sample app that has this working, would be greatly appreciated !
Feedback created https://feedbackassistant.apple.com/feedback/15034882